﻿Public Class frmPrincipal
    
    Public Shared iniciais As String
    Private Sub VersãoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles VersãoToolStripMenuItem.Click
        Try
            Dim form As New frmSplash
            generica.fechaForms(Me)
            form.MdiParent = Me
            form.Show()
        Catch ex As Exception
            generica.gravaErro(ex)
        End Try
    End Sub

    Private Sub EixbirLogDeErroToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EixbirLogDeErroToolStripMenuItem.Click
        Try
            Dim form As New frmLogErro
            generica.fechaForms(Me)
            form.MdiParent = Me
            form.Show()
        Catch ex As Exception
            generica.gravaErro(ex)
        End Try
    End Sub

    Private Sub SairToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles SairToolStripMenuItem.Click
        Application.Exit()
    End Sub

    Private Sub EliminarProcessosWordToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles EliminarProcessosWordToolStripMenuItem.Click
        Try
            Dim form As New frmKillWord
            generica.fechaForms(Me)
            form.MdiParent = Me
            form.Show()
        Catch ex As Exception
            generica.gravaErro(ex)
        End Try
    End Sub

    Private Sub AbrirDiretorioNoQualOsLaudosEstaoArmazenadosToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles AbrirDiretorioNoQualOsLaudosEstaoArmazenadosToolStripMenuItem.Click
        Try

            Dim path As String = System.Configuration.ConfigurationManager.AppSettings("dirLaudosWord")
            Dim diretorio As String = IO.Path.Combine(System.Windows.Forms.Application.StartupPath, path)
            ofdDiretorio.InitialDirectory = diretorio
            ofdDiretorio.ShowDialog()
            generica.visualizaWord(Nothing, ofdDiretorio.FileName, True)
        Catch ex As Exception
            generica.gravaErro(ex)
        End Try
    End Sub

    Private Sub DigitarLaudoToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles DigitarLaudoToolStripMenuItem.Click
        Try
            Dim form As New frmToxicologico
            generica.fechaForms(Me)
            form.MdiParent = Me
            form.Show()
        Catch ex As Exception
            generica.gravaErro(ex)
        End Try
    End Sub
End Class